3.1000 \(\int \frac{(A+B \cos (c+d x)+C \cos ^2(c+d x)) \sec ^3(c+d x)}{(a+b \cos (c+d x))^3} \, dx\)

Optimal. Leaf size=462 \[ -\frac{b \left (5 a^4 b^2 (4 A-C)-a^2 b^4 (29 A-2 C)+15 a^3 b^3 B-12 a^5 b B+6 a^6 C-6 a b^5 B+12 A b^6\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^5 d (a-b)^{5/2} (a+b)^{5/2}}-\frac{\tan (c+d x) \left (-a^2 b^3 (21 A-2 C)+a^4 b (6 A-5 C)+11 a^3 b^2 B-2 a^5 B-6 a b^4 B+12 A b^5\right )}{2 a^4 d \left (a^2-b^2\right )^2}+\frac{\left (a^2 (A+2 C)-6 a b B+12 A b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 a^5 d}+\frac{\tan (c+d x) \sec (c+d x) \left (-a^2 b^2 (10 A-C)+a^4 (A-4 C)+6 a^3 b B-3 a b^3 B+6 A b^4\right )}{2 a^3 d \left (a^2-b^2\right )^2}+\frac{\tan (c+d x) \sec (c+d x) \left (7 a^2 A b^2-5 a^3 b B+3 a^4 C+2 a b^3 B-4 A b^4\right )}{2 a^2 d \left (a^2-b^2\right )^2 (a+b \cos (c+d x))}+\frac{\tan (c+d x) \sec (c+d x) \left (A b^2-a (b B-a C)\right )}{2 a d \left (a^2-b^2\right ) (a+b \cos (c+d x))^2} \]

[Out]

-((b*(12*A*b^6 - 12*a^5*b*B + 15*a^3*b^3*B - 6*a*b^5*B - a^2*b^4*(29*A - 2*C) + 5*a^4*b^2*(4*A - C) + 6*a^6*C)
*ArcTan[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(a^5*(a - b)^(5/2)*(a + b)^(5/2)*d)) + ((12*A*b^2 - 6*a*b
*B + a^2*(A + 2*C))*ArcTanh[Sin[c + d*x]])/(2*a^5*d) - ((12*A*b^5 - 2*a^5*B + 11*a^3*b^2*B - 6*a*b^4*B + a^4*b
*(6*A - 5*C) - a^2*b^3*(21*A - 2*C))*Tan[c + d*x])/(2*a^4*(a^2 - b^2)^2*d) + ((6*A*b^4 + 6*a^3*b*B - 3*a*b^3*B
 + a^4*(A - 4*C) - a^2*b^2*(10*A - C))*Sec[c + d*x]*Tan[c + d*x])/(2*a^3*(a^2 - b^2)^2*d) + ((A*b^2 - a*(b*B -
 a*C))*Sec[c + d*x]*Tan[c + d*x])/(2*a*(a^2 - b^2)*d*(a + b*Cos[c + d*x])^2) + ((7*a^2*A*b^2 - 4*A*b^4 - 5*a^3
*b*B + 2*a*b^3*B + 3*a^4*C)*Sec[c + d*x]*Tan[c + d*x])/(2*a^2*(a^2 - b^2)^2*d*(a + b*Cos[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 5.1589, antiderivative size = 462, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 5, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.122, Rules used = {3055, 3001, 3770, 2659, 205} \[ -\frac{b \left (5 a^4 b^2 (4 A-C)-a^2 b^4 (29 A-2 C)+15 a^3 b^3 B-12 a^5 b B+6 a^6 C-6 a b^5 B+12 A b^6\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^5 d (a-b)^{5/2} (a+b)^{5/2}}-\frac{\tan (c+d x) \left (-a^2 b^3 (21 A-2 C)+a^4 b (6 A-5 C)+11 a^3 b^2 B-2 a^5 B-6 a b^4 B+12 A b^5\right )}{2 a^4 d \left (a^2-b^2\right )^2}+\frac{\left (a^2 (A+2 C)-6 a b B+12 A b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 a^5 d}+\frac{\tan (c+d x) \sec (c+d x) \left (-a^2 b^2 (10 A-C)+a^4 (A-4 C)+6 a^3 b B-3 a b^3 B+6 A b^4\right )}{2 a^3 d \left (a^2-b^2\right )^2}+\frac{\tan (c+d x) \sec (c+d x) \left (7 a^2 A b^2-5 a^3 b B+3 a^4 C+2 a b^3 B-4 A b^4\right )}{2 a^2 d \left (a^2-b^2\right )^2 (a+b \cos (c+d x))}+\frac{\tan (c+d x) \sec (c+d x) \left (A b^2-a (b B-a C)\right )}{2 a d \left (a^2-b^2\right ) (a+b \cos (c+d x))^2} \]

Antiderivative was successfully verified.

[In]

Int[((A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^3)/(a + b*Cos[c + d*x])^3,x]

[Out]

-((b*(12*A*b^6 - 12*a^5*b*B + 15*a^3*b^3*B - 6*a*b^5*B - a^2*b^4*(29*A - 2*C) + 5*a^4*b^2*(4*A - C) + 6*a^6*C)
*ArcTan[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(a^5*(a - b)^(5/2)*(a + b)^(5/2)*d)) + ((12*A*b^2 - 6*a*b
*B + a^2*(A + 2*C))*ArcTanh[Sin[c + d*x]])/(2*a^5*d) - ((12*A*b^5 - 2*a^5*B + 11*a^3*b^2*B - 6*a*b^4*B + a^4*b
*(6*A - 5*C) - a^2*b^3*(21*A - 2*C))*Tan[c + d*x])/(2*a^4*(a^2 - b^2)^2*d) + ((6*A*b^4 + 6*a^3*b*B - 3*a*b^3*B
 + a^4*(A - 4*C) - a^2*b^2*(10*A - C))*Sec[c + d*x]*Tan[c + d*x])/(2*a^3*(a^2 - b^2)^2*d) + ((A*b^2 - a*(b*B -
 a*C))*Sec[c + d*x]*Tan[c + d*x])/(2*a*(a^2 - b^2)*d*(a + b*Cos[c + d*x])^2) + ((7*a^2*A*b^2 - 4*A*b^4 - 5*a^3
*b*B + 2*a*b^3*B + 3*a^4*C)*Sec[c + d*x]*Tan[c + d*x])/(2*a^2*(a^2 - b^2)^2*d*(a + b*Cos[c + d*x]))

Rule 3055

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*s
in[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> -Simp[((A*b^2 - a*b*B + a^2*C)*Cos[e +
 f*x]*(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^(n + 1))/(f*(m + 1)*(b*c - a*d)*(a^2 - b^2)), x] + Dis
t[1/((m + 1)*(b*c - a*d)*(a^2 - b^2)), Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[(m + 1)*(b
*c - a*d)*(a*A - b*B + a*C) + d*(A*b^2 - a*b*B + a^2*C)*(m + n + 2) - (c*(A*b^2 - a*b*B + a^2*C) + (m + 1)*(b*
c - a*d)*(A*b - a*B + b*C))*Sin[e + f*x] - d*(A*b^2 - a*b*B + a^2*C)*(m + n + 3)*Sin[e + f*x]^2, x], x], x] /;
 FreeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && Lt
Q[m, -1] && ((EqQ[a, 0] && IntegerQ[m] &&  !IntegerQ[n]) ||  !(IntegerQ[2*n] && LtQ[n, -1] && ((IntegerQ[n] &&
  !IntegerQ[m]) || EqQ[a, 0])))

Rule 3001

Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])/(((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.)
+ (f_.)*(x_)])), x_Symbol] :> Dist[(A*b - a*B)/(b*c - a*d), Int[1/(a + b*Sin[e + f*x]), x], x] + Dist[(B*c - A
*d)/(b*c - a*d), Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0]
 && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x)}{(a+b \cos (c+d x))^3} \, dx &=\frac{\left (A b^2-a (b B-a C)\right ) \sec (c+d x) \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}+\frac{\int \frac{\left (-2 \left (2 A b^2-a b B-a^2 (A-C)\right )-2 a (A b-a B+b C) \cos (c+d x)+3 \left (A b^2-a (b B-a C)\right ) \cos ^2(c+d x)\right ) \sec ^3(c+d x)}{(a+b \cos (c+d x))^2} \, dx}{2 a \left (a^2-b^2\right )}\\ &=\frac{\left (A b^2-a (b B-a C)\right ) \sec (c+d x) \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}+\frac{\left (7 a^2 A b^2-4 A b^4-5 a^3 b B+2 a b^3 B+3 a^4 C\right ) \sec (c+d x) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}+\frac{\int \frac{\left (2 \left (6 A b^4+6 a^3 b B-3 a b^3 B+a^4 (A-4 C)-a^2 b^2 (10 A-C)\right )+a \left (A b^3+2 a^3 B+a b^2 B-a^2 b (4 A+3 C)\right ) \cos (c+d x)+2 \left (7 a^2 A b^2-4 A b^4-5 a^3 b B+2 a b^3 B+3 a^4 C\right ) \cos ^2(c+d x)\right ) \sec ^3(c+d x)}{a+b \cos (c+d x)} \, dx}{2 a^2 \left (a^2-b^2\right )^2}\\ &=\frac{\left (6 A b^4+6 a^3 b B-3 a b^3 B+a^4 (A-4 C)-a^2 b^2 (10 A-C)\right ) \sec (c+d x) \tan (c+d x)}{2 a^3 \left (a^2-b^2\right )^2 d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec (c+d x) \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}+\frac{\left (7 a^2 A b^2-4 A b^4-5 a^3 b B+2 a b^3 B+3 a^4 C\right ) \sec (c+d x) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}+\frac{\int \frac{\left (-2 \left (12 A b^5-2 a^5 B+11 a^3 b^2 B-6 a b^4 B-a^2 b^3 (21 A-2 C)+a^4 (6 A b-5 b C)\right )-2 a \left (2 A b^4+4 a^3 b B-a b^3 B-a^2 b^2 (4 A+C)-a^4 (A+2 C)\right ) \cos (c+d x)+2 b \left (6 A b^4+6 a^3 b B-3 a b^3 B+a^4 (A-4 C)-a^2 b^2 (10 A-C)\right ) \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx}{4 a^3 \left (a^2-b^2\right )^2}\\ &=-\frac{\left (12 A b^5-2 a^5 B+11 a^3 b^2 B-6 a b^4 B+a^4 b (6 A-5 C)-a^2 b^3 (21 A-2 C)\right ) \tan (c+d x)}{2 a^4 \left (a^2-b^2\right )^2 d}+\frac{\left (6 A b^4+6 a^3 b B-3 a b^3 B+a^4 (A-4 C)-a^2 b^2 (10 A-C)\right ) \sec (c+d x) \tan (c+d x)}{2 a^3 \left (a^2-b^2\right )^2 d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec (c+d x) \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}+\frac{\left (7 a^2 A b^2-4 A b^4-5 a^3 b B+2 a b^3 B+3 a^4 C\right ) \sec (c+d x) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}+\frac{\int \frac{\left (2 \left (a^2-b^2\right )^2 \left (12 A b^2-6 a b B+a^2 (A+2 C)\right )+2 a b \left (6 A b^4+6 a^3 b B-3 a b^3 B+a^4 (A-4 C)-a^2 b^2 (10 A-C)\right ) \cos (c+d x)\right ) \sec (c+d x)}{a+b \cos (c+d x)} \, dx}{4 a^4 \left (a^2-b^2\right )^2}\\ &=-\frac{\left (12 A b^5-2 a^5 B+11 a^3 b^2 B-6 a b^4 B+a^4 b (6 A-5 C)-a^2 b^3 (21 A-2 C)\right ) \tan (c+d x)}{2 a^4 \left (a^2-b^2\right )^2 d}+\frac{\left (6 A b^4+6 a^3 b B-3 a b^3 B+a^4 (A-4 C)-a^2 b^2 (10 A-C)\right ) \sec (c+d x) \tan (c+d x)}{2 a^3 \left (a^2-b^2\right )^2 d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec (c+d x) \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}+\frac{\left (7 a^2 A b^2-4 A b^4-5 a^3 b B+2 a b^3 B+3 a^4 C\right ) \sec (c+d x) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}-\frac{\left (b \left (12 A b^6-12 a^5 b B+15 a^3 b^3 B-6 a b^5 B-a^2 b^4 (29 A-2 C)+5 a^4 b^2 (4 A-C)+6 a^6 C\right )\right ) \int \frac{1}{a+b \cos (c+d x)} \, dx}{2 a^5 \left (a^2-b^2\right )^2}+\frac{\left (12 A b^2-6 a b B+a^2 (A+2 C)\right ) \int \sec (c+d x) \, dx}{2 a^5}\\ &=\frac{\left (12 A b^2-6 a b B+a^2 (A+2 C)\right ) \tanh ^{-1}(\sin (c+d x))}{2 a^5 d}-\frac{\left (12 A b^5-2 a^5 B+11 a^3 b^2 B-6 a b^4 B+a^4 b (6 A-5 C)-a^2 b^3 (21 A-2 C)\right ) \tan (c+d x)}{2 a^4 \left (a^2-b^2\right )^2 d}+\frac{\left (6 A b^4+6 a^3 b B-3 a b^3 B+a^4 (A-4 C)-a^2 b^2 (10 A-C)\right ) \sec (c+d x) \tan (c+d x)}{2 a^3 \left (a^2-b^2\right )^2 d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec (c+d x) \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}+\frac{\left (7 a^2 A b^2-4 A b^4-5 a^3 b B+2 a b^3 B+3 a^4 C\right ) \sec (c+d x) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}-\frac{\left (b \left (12 A b^6-12 a^5 b B+15 a^3 b^3 B-6 a b^5 B-a^2 b^4 (29 A-2 C)+5 a^4 b^2 (4 A-C)+6 a^6 C\right )\right ) \operatorname{Subst}\left (\int \frac{1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{a^5 \left (a^2-b^2\right )^2 d}\\ &=-\frac{b \left (20 a^4 A b^2-29 a^2 A b^4+12 A b^6-12 a^5 b B+15 a^3 b^3 B-6 a b^5 B+6 a^6 C-5 a^4 b^2 C+2 a^2 b^4 C\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^5 (a-b)^{5/2} (a+b)^{5/2} d}+\frac{\left (12 A b^2-6 a b B+a^2 (A+2 C)\right ) \tanh ^{-1}(\sin (c+d x))}{2 a^5 d}-\frac{\left (12 A b^5-2 a^5 B+11 a^3 b^2 B-6 a b^4 B+a^4 b (6 A-5 C)-a^2 b^3 (21 A-2 C)\right ) \tan (c+d x)}{2 a^4 \left (a^2-b^2\right )^2 d}+\frac{\left (6 A b^4+6 a^3 b B-3 a b^3 B+a^4 (A-4 C)-a^2 b^2 (10 A-C)\right ) \sec (c+d x) \tan (c+d x)}{2 a^3 \left (a^2-b^2\right )^2 d}+\frac{\left (A b^2-a (b B-a C)\right ) \sec (c+d x) \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}+\frac{\left (7 a^2 A b^2-4 A b^4-5 a^3 b B+2 a b^3 B+3 a^4 C\right ) \sec (c+d x) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}\\ \end{align*}

Mathematica [A]  time = 3.91707, size = 606, normalized size = 1.31 \[ \frac{\frac{16 b \left (5 a^4 b^2 (4 A-C)+a^2 b^4 (2 C-29 A)+15 a^3 b^3 B-12 a^5 b B+6 a^6 C-6 a b^5 B+12 A b^6\right ) \tanh ^{-1}\left (\frac{(a-b) \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{b^2-a^2}}\right )}{\left (b^2-a^2\right )^{5/2}}-8 \left (a^2 (A+2 C)-6 a b B+12 A b^2\right ) \log \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )+8 \left (a^2 (A+2 C)-6 a b B+12 A b^2\right ) \log \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )+\frac{2 a \tan (c+d x) \sec (c+d x) \left (2 a b \cos (2 (c+d x)) \left (a^2 b^3 (32 A-3 C)+a^4 (6 b C-11 A b)-16 a^3 b^2 B+4 a^5 B+9 a b^4 B-18 A b^5\right )+\cos (c+d x) \left (a^4 b^3 (14 A+15 C)+a^2 b^5 (47 A-6 C)-16 a^6 A b-10 a^5 b^2 B-25 a^3 b^4 B+8 a^7 B+18 a b^6 B-36 A b^7\right )-6 a^4 A b^3 \cos (3 (c+d x))+21 a^2 A b^5 \cos (3 (c+d x))-30 a^5 A b^2+68 a^3 A b^4+4 a^7 A+2 a^5 b^2 B \cos (3 (c+d x))-11 a^3 b^4 B \cos (3 (c+d x))-32 a^4 b^3 B+18 a^2 b^5 B+5 a^4 b^3 C \cos (3 (c+d x))-2 a^2 b^5 C \cos (3 (c+d x))+12 a^5 b^2 C-6 a^3 b^4 C+8 a^6 b B-36 a A b^6+6 a b^6 B \cos (3 (c+d x))-12 A b^7 \cos (3 (c+d x))\right )}{\left (a^2-b^2\right )^2 (a+b \cos (c+d x))^2}}{16 a^5 d} \]

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^3)/(a + b*Cos[c + d*x])^3,x]

[Out]

((16*b*(12*A*b^6 - 12*a^5*b*B + 15*a^3*b^3*B - 6*a*b^5*B + 5*a^4*b^2*(4*A - C) + 6*a^6*C + a^2*b^4*(-29*A + 2*
C))*ArcTanh[((a - b)*Tan[(c + d*x)/2])/Sqrt[-a^2 + b^2]])/(-a^2 + b^2)^(5/2) - 8*(12*A*b^2 - 6*a*b*B + a^2*(A
+ 2*C))*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 8*(12*A*b^2 - 6*a*b*B + a^2*(A + 2*C))*Log[Cos[(c + d*x)/2]
 + Sin[(c + d*x)/2]] + (2*a*(4*a^7*A - 30*a^5*A*b^2 + 68*a^3*A*b^4 - 36*a*A*b^6 + 8*a^6*b*B - 32*a^4*b^3*B + 1
8*a^2*b^5*B + 12*a^5*b^2*C - 6*a^3*b^4*C + (-16*a^6*A*b - 36*A*b^7 + 8*a^7*B - 10*a^5*b^2*B - 25*a^3*b^4*B + 1
8*a*b^6*B + a^2*b^5*(47*A - 6*C) + a^4*b^3*(14*A + 15*C))*Cos[c + d*x] + 2*a*b*(-18*A*b^5 + 4*a^5*B - 16*a^3*b
^2*B + 9*a*b^4*B + a^2*b^3*(32*A - 3*C) + a^4*(-11*A*b + 6*b*C))*Cos[2*(c + d*x)] - 6*a^4*A*b^3*Cos[3*(c + d*x
)] + 21*a^2*A*b^5*Cos[3*(c + d*x)] - 12*A*b^7*Cos[3*(c + d*x)] + 2*a^5*b^2*B*Cos[3*(c + d*x)] - 11*a^3*b^4*B*C
os[3*(c + d*x)] + 6*a*b^6*B*Cos[3*(c + d*x)] + 5*a^4*b^3*C*Cos[3*(c + d*x)] - 2*a^2*b^5*C*Cos[3*(c + d*x)])*Se
c[c + d*x]*Tan[c + d*x])/((a^2 - b^2)^2*(a + b*Cos[c + d*x])^2))/(16*a^5*d)

________________________________________________________________________________________

Maple [B]  time = 0.121, size = 2202, normalized size = 4.8 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3/(a+b*cos(d*x+c))^3,x)

[Out]

-8/d/a/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)^2*b^3/(a-b)/(a^2+2*a*b+b^2)*tan(1/2*d*x+1/2*c)^3*B-
1/d/a^2/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)^2*b^4/(a-b)/(a^2+2*a*b+b^2)*tan(1/2*d*x+1/2*c)^3*B
-8/d/a/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)^2*b^3/(a+b)/(a-b)^2*tan(1/2*d*x+1/2*c)*B+1/d/a^2/(a
*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)^2*b^4/(a+b)/(a-b)^2*tan(1/2*d*x+1/2*c)*B+1/d/a^3/(a*tan(1/2*
d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)^2*b^5/(a-b)/(a^2+2*a*b+b^2)*tan(1/2*d*x+1/2*c)^3*A+6/d/(a*tan(1/2*d*x
+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)^2/(a+b)/(a-b)^2*tan(1/2*d*x+1/2*c)*b^2*C-20/d/a*b^3/(a^4-2*a^2*b^2+b^4)/
((a+b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a+b)*(a-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+
2*a*b+b^2)*tan(1/2*d*x+1/2*c)^3*A*b^4+10/d/a^2/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)^2/(a+b)/(a-
b)^2*tan(1/2*d*x+1/2*c)*A*b^4+6/d*b^6/a^4/(a^4-2*a^2*b^2+b^4)/((a+b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2
*c)/((a+b)*(a-b))^(1/2))*B-15/d*b^4/a^2/(a^4-2*a^2*b^2+b^4)/((a+b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c
)/((a+b)*(a-b))^(1/2))*B+4/d*b^5/a^3/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)^2/(a+b)/(a-b)^2*tan(1
/2*d*x+1/2*c)*B+4/d*b^5/a^3/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b+a+b)^2/(a-b)/(a^2+2*a*b+b^2)*tan(1/
2*d*x+1/2*c)^3*B

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3/(a+b*cos(d*x+c))^3,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3/(a+b*cos(d*x+c))^3,x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**3/(a+b*cos(d*x+c))**3,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.3886, size = 2354, normalized size = 5.1 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3/(a+b*cos(d*x+c))^3,x, algorithm="giac")

[Out]

1/2*(2*(6*C*a^6*b - 12*B*a^5*b^2 + 20*A*a^4*b^3 - 5*C*a^4*b^3 + 15*B*a^3*b^4 - 29*A*a^2*b^5 + 2*C*a^2*b^5 - 6*
B*a*b^6 + 12*A*b^7)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(-2*a + 2*b) + arctan(-(a*tan(1/2*d*x + 1/2*c) - b*ta
n(1/2*d*x + 1/2*c))/sqrt(a^2 - b^2)))/((a^9 - 2*a^7*b^2 + a^5*b^4)*sqrt(a^2 - b^2)) + 2*(A*a^7*tan(1/2*d*x + 1
/2*c)^7 - 2*B*a^7*tan(1/2*d*x + 1/2*c)^7 + 4*A*a^6*b*tan(1/2*d*x + 1/2*c)^7 + 4*B*a^6*b*tan(1/2*d*x + 1/2*c)^7
 - 13*A*a^5*b^2*tan(1/2*d*x + 1/2*c)^7 + 2*B*a^5*b^2*tan(1/2*d*x + 1/2*c)^7 + 6*C*a^5*b^2*tan(1/2*d*x + 1/2*c)
^7 - 2*A*a^4*b^3*tan(1/2*d*x + 1/2*c)^7 - 16*B*a^4*b^3*tan(1/2*d*x + 1/2*c)^7 - 5*C*a^4*b^3*tan(1/2*d*x + 1/2*
c)^7 + 33*A*a^3*b^4*tan(1/2*d*x + 1/2*c)^7 + 9*B*a^3*b^4*tan(1/2*d*x + 1/2*c)^7 - 3*C*a^3*b^4*tan(1/2*d*x + 1/
2*c)^7 - 17*A*a^2*b^5*tan(1/2*d*x + 1/2*c)^7 + 9*B*a^2*b^5*tan(1/2*d*x + 1/2*c)^7 + 2*C*a^2*b^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2*d*x + 1/2*
c)^4 - b*tan(1/2*d*x + 1/2*c)^4 + 2*b*tan(1/2*d*x + 1/2*c)^2 - a - b)^2) + (A*a^2 + 2*C*a^2 - 6*B*a*b + 12*A*b
^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a^5 - (A*a^2 + 2*C*a^2 - 6*B*a*b + 12*A*b^2)*log(abs(tan(1/2*d*x + 1/2*
c) - 1))/a^5)/d